﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.WaypointPlanSuccessImageConvertor
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands;

public class WaypointPlanSuccessImageConvertor : IValueConverter
{
  private static string s_iconSVGSuccess = "SuccessfulGreen";
  private static string s_iconSVGSuccessPreprocess = "SuccessfulGreen";
  private static string s_iconSVGCalcfail = "ErrorColor";
  private static string s_iconSVGCollision = "CollisionFailColor";
  private static string s_iconSVGSkip = "DisapproveGrey";
  private static string s_iconSVGProcessing = "Calculating";
  private static string s_iconSVGBeforeprocessing = "Time";
  private static string s_iconSVGSecticonVolumeCollision = "CollisionWithSectionVolume";
  private static string s_iconSVGNoReach = "UnreachableLocation";
  private static string s_iconSVGRcsCollisionError = "CollisionDuringRrs";
  private static string s_iconSVGRcsSimulationError = "RssError";
  private static string s_iconSVGRcsSuccess = "ResolvedCollisionDuringRrs";

  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  {
    CApAPPWaypointPlanSuccess waypointPlanSuccess = (CApAPPWaypointPlanSuccess) value;
    string str = "";
    switch (waypointPlanSuccess)
    {
      case CApAPPWaypointPlanSuccess.CalcSuccess:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGSuccess;
        break;
      case CApAPPWaypointPlanSuccess.Cancel:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGSkip;
        break;
      case CApAPPWaypointPlanSuccess.CalcFail:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGCalcfail;
        break;
      case CApAPPWaypointPlanSuccess.WaitingForCalc:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGProcessing;
        break;
      case CApAPPWaypointPlanSuccess.Collision:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGCollision;
        break;
      case CApAPPWaypointPlanSuccess.SectionVolumeCollision:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGSecticonVolumeCollision;
        break;
      case CApAPPWaypointPlanSuccess.WaitingBeforeCalc:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGBeforeprocessing;
        break;
      case CApAPPWaypointPlanSuccess.LocReachFail:
      case CApAPPWaypointPlanSuccess.OutOfLimits:
      case CApAPPWaypointPlanSuccess.TwistedCable:
      case CApAPPWaypointPlanSuccess.SingularityZone:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGNoReach;
        break;
      case CApAPPWaypointPlanSuccess.PreProcessingSuccess:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGSuccessPreprocess;
        break;
      case CApAPPWaypointPlanSuccess.PostProcessingSuccess:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGRcsSuccess;
        break;
      case CApAPPWaypointPlanSuccess.PostProcessingCollisionError:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGRcsCollisionError;
        break;
      case CApAPPWaypointPlanSuccess.PostProcessingSimulationError:
        str = WaypointPlanSuccessImageConvertor.s_iconSVGRcsSimulationError;
        break;
    }
    return str == "" ? (object) null : (object) TxImageManager.GetImageByKey(str).ConvertTo<ImageSource>(16U /*0x10*/, 16U /*0x10*/);
  }

  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}
